/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 fire_ring.h

	$Header: /game/fire_ring.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( FIRE_RING_H_INCLUDED )
#define FIRE_RING_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "combat_creature_list.h"
#include "combat_spell.h"
#include "map_point.h"
// --------------------------------------------------------------------
// handle fire ring spell
// --------------------------------------------------------------------

class t_fire_ring : public t_combat_spell
{
public:
	t_fire_ring( t_battlefield& battlefield, t_spell spell );

	virtual bool            begin_casting();
	virtual bool			cast_on( t_combat_creature_ptr caster, 
		                             t_combat_creature_ptr target, 
									 int power,
									 bool is_mirror );
	virtual bool					can_cast( t_screen_point const& point ) const;
	virtual void					execute( t_combat_creature& caster );
	virtual void					execute_mirror_spell( t_combat_creature_ptr creature, 
														  int power );
	virtual t_combat_ai_action_list generate_combat_ai_action_list(t_combat_ai &owner);
	virtual double					get_cancel_weight( t_combat_creature const& target ) const;
	virtual t_mouse_window* mouse_move( t_screen_point const& point,
									    std::string& help_text );
	virtual bool            left_click( t_screen_point const& point );

	static void  get_basic_target_list( t_battlefield& battlefield, 
									    t_map_point_2d const& cell, 
										t_combat_creature_list &result );
	static void  get_basic_target_list( t_battlefield& battlefield,
										const t_combat_creature* subject, 
										t_combat_creature_list &result ); 

protected:
	bool					can_cast( t_screen_point const&   point,
									  t_combat_creature_ptr&  creature,
									  t_map_point_2d       &  map_point,
									  t_combat_creature_list& targets,
									  std::string*		    help_text ) const;
	t_combat_creature_list  get_targets( t_map_point_2d const& cell ) const;
	t_combat_creature_list  get_targets( t_combat_creature* subject ) const;
	t_combat_creature_list  get_targets( t_map_point_2d const& center,
										 t_combat_creature*    subject,
										 int				   footprint_size ) const;
	
	static void  get_basic_target_list( t_battlefield& battlefield,
										t_map_point_2d const   &center,
									    const t_combat_creature      *subject,
									    int				        footprint_size,
									    t_combat_creature_list &result );

	t_map_point_2d         m_target_square;
	t_combat_creature_ptr  m_target;
	t_combat_creature_list m_targets;
};

#endif // FIRE_RING_H_INCLUDED